Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

428
Views
AG Grid: Receiving "invalid row index for ensureIndexVisible" for valid row indexes

I am receiving "invalid row index for ensureIndexVisible" for valid row indexes.

For example:

invalid row index for ensureIndexVisible: 0
invalid row index for ensureIndexVisible: 3

I am not implementing getRowNodeId. Instead, I am letting AG Grid build the IDs, but the problem occurs either way I try it.

Here's the related code in the component:

gridOptions = {
    onGridReady: (params: any) => {
        params.api.sizeColumnsToFit();
    },
    onRowClicked: (params: any) => {
      localStorage.setItem('lastDeveloper', params.node.id.toString());
      this.router.navigate(['developers', params.node.data.id], { state: params.node.data });
    },
    onFirstDataRendered: (params: any) => {
      const lastDeveloperSelected = localStorage.getItem('lastDeveloper');
        if (lastDeveloperSelected) {
          params.api.ensureIndexVisible(lastDeveloperSelected, 'middle');
        }
    }
  }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This appears to have been a type problem, and ensuring the index was a number and not a string made the difference:

params.api.ensureIndexVisible(+lastDeveloperSelected, 'middle');
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!